﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel.Web;

namespace D3DSS.IoC
{
    internal class SecureIoCWebServiceHost : WebServiceHost
    {
        public SecureIoCWebServiceHost(object singletonInstance, params Uri[] baseAddresses)
            : base(singletonInstance, baseAddresses)
        {
            base.Authorization.ServiceAuthorizationManager = new SecureServiceAuthorizationManager();
        }

        public SecureIoCWebServiceHost(Type serviceType, params Uri[] baseAddresses)
            : base(serviceType, baseAddresses)
        {
            base.Authorization.ServiceAuthorizationManager = new SecureServiceAuthorizationManager();
        }

        protected override void OnOpening()
        {
            Description.Behaviors.Add(new IoCMapServiceBehavior());
            base.OnOpening();
        }
    }
}
